<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>填写申请</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />

    <style type="text/css">
        .back{
            padding: 30px 30px ;

            width: 1250px;
            height: 1000px;

        }
        .part{

            width: 1250px;
            height: 300px;
        }
        table{
            font-family: verdana,arial,sans-serif;
            font-size:14px;
            color:#333333;
            border-width: 1px;
            border-color: #666666;

        }
        table th{
            padding: 8px;
            width: 150px;
            height: 50px;
            text-align: right;
        }
        table td{
            padding: 8px;
            width: 150px;
            height: 50px;
        }
        /*.tr1{
            background: #efefef;font-size: 14px;height:50px;
        }
        .tr2{
            height: 60px;border-bottom: 2px solid #eaeaea;font-size: 13px;
        }*/
        input{
            padding-right: 10px;
            margin-top: 10px;
            width: 200px;
            height: 30px;
            border-radius: 5px;
            border: 1px solid #4169E1;

        }
        select{
            margin-top: 10px;
            width: 200px;
            height: 30px;
            border: 1px solid #4169E1;
        }
        .submitButton{
            margin-left: 1150px;
            width: 95px;
            height: 45px;
            border-radius: 5px;
            color: white;
            background-color: #4169E1;
        }
        a{
            color: #33CCFF;
        }
        textarea{
            width:1100px;
            height:80px;
            border: 1px solid #4169E1;
        }
        input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
        input[type="number"]{ -moz-appearance: textfield; }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">

    <!-- header -->
    <div th:replace="~{commons/header::header}"></div>

    <!-- left -->
    <div th:replace="~{commons/employerLeft::left}"></div>
    <!-- 内容主体区域 -->
    <div class="layui-body">
        <div class="back">
            <h1 style="text-align: center;">用人单位申请</h1>

            <div class="part">
                <form action="/hw_unit_writeApply" method="post" name="myForm" onsubmit="return validateForm();"  autocomplete="off">
                    <input class="submitButton" type="submit" value="保存" />
                    <table>
                        <tr >
                            <th>用工批次:</th>
                            <td>
                                <select name="batchTeam">
                                    <option th:each="teamList:${laborBatch}" th:text="${teamList.getBatchTeam()}"></option>
                                </select>
                            </td>
                            <th>用工单位:</th>
                            <td>
                                <select name="laborUnit">
                                    <option value="学工处">学工处</option>
                                    <option value="图书馆">图书馆</option>
                                    <option value="财务部">财务部</option>
                                    <option value="心理咨询中心">心理咨询中心</option>
                                    <option value="创四方园">创四方园</option>
                                </select>
                            </td>
                            <th>需求人数:</th>
                            <td><input type="number" name="laborRequestNum"></td>
                        </tr>
                        <tr >

                            <th>本期招聘人数:</th>
                            <td><input type="number" name="laborRecruitersNum"></td>
                            <th>工资标准:</th>
                            <td><input type="text" name="laborStandard" placeholder="元/小时"></td>

                        </tr>

                        <tr>
                            <th  > 申请理由:</th>
                            <td colspan="5" ><textarea name="laborReason"  ></textarea>
                        </tr>


                        <tr  >
                            <th colspan="2" style="text-align: center;background: #efefef;">工作内容</th>
                            <th colspan="2" style="text-align: center;background: #efefef;"> 工作时间、工作量</th>
                            <th colspan="2" style="text-align: center;background: #efefef;">月工作时数</th>

                        </tr>
                        <tr  >

                            <td colspan="2" style="text-align: center;"><input type="text" name="content1" ></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="time1"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="month1"></td>
                        </tr>
                        <tr >
                            <td colspan="2" style="text-align: center;"><input type="text" name="content2"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="time2"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="month2"></td>
                        </tr>
                        <tr >
                            <td colspan="2" style="text-align: center;" ><input type="text" name="content3"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="time3"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="month3"></td>
                        </tr>
                        <tr >
                            <td colspan="2" style="text-align: center;"><input type="text" name="content4"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="time4"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="month4"></td>
                        </tr>
                        <tr >
                            <td colspan="2" style="text-align: center;"><input type="text" name="content5"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="time5"></td>
                            <td colspan="2" style="text-align: center;"><input type="text" name="month5"></td>
                        </tr>
                    </table>

                </form>
            </div>

        </div>
    </div>
</div>
<script th:src="@{/layui/layui.js}"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function() {
        var element = layui.element;
    });
    function validateForm() {
        var batchTeam = document.forms["myForm"]["batchTeam"].value;
        var laborRequestNum = document.forms["myForm"]["laborRequestNum"].value;
        var laborRecruitersNum = document.forms["myForm"]["laborRecruitersNum"].value;
        var laborStandard = document.forms["myForm"]["laborStandard"].value;
    if(laborRequestNum<laborRecruitersNum){
        alert("需求人数不能小于本期招聘人数");
        return false;
    }else if (batchTeam.length == 0 || laborRequestNum.length == 0 || laborRecruitersNum.length == 0 || laborStandard.length == 0) {
            alert("输入不能为空");
            return false;
    }else{
            alert("提交成功");
            return true;
    }
    }
</script>
</body>
</html>
